export const setTransition=function({
    dom,
    start,
    end,
    className=''
}){
    className&&dom.classList.add(className);

    const cancel=()=>{
        dom.removeEventListener('transitionend',_end);
    };
    const _end=function(){
        cancel();
        className&&dom.classList.remove(className);
        end&&end();
    };
    dom.addEventListener('transitionend',_end);
    start&&start(dom);

    return {
        cancel,
        end:_end
    }
};
export default setTransition;